This is the documentation for the Realbasic Plugins from Monkeybreadsoftware.de. You find these plugins and the newest version of this document at http://www.monkeybreadsoftware.de/realbasic inside the plugins section.
This help was last updated on Freitag, 6. September 2002 and covers 2136 items: 126 classes, 2 controls and 583 global functions.
The list of the themes | Global methods by category | Global methods by name | The list of the classes | The list of the controls |
class CatSearch | |||||||||||||||||||||||||||||||||
class, Catalog Search | Mo, 15. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
Allows you to search fast on your harddisk. | |||||||||||||||||||||||||||||||||
Notes:
This class implements the PBCatSearch function of the Mac OS File Manager. This is a very fast routine to find specific types of files on a volume. The MacOS tool Sherlock (aka Find File) uses this function to its quick search on local volumes. There's some restrictions to CatSearch: Is it not supported on every volume! Whether it is supported or not depents on the File System format used on the Volume: HFS, HFS+ and most File Servers support it, while Floppy Disks, ISO 9660 and UDF formatted disks, used on some CDs and on most DVD-ROMs, might not support it. This version of this plugin can now handle those cases where CatSearch is not supported, too: If a volume does not support CatSearch, you can choose to fall back to the classic recursive directory search, which is much slower, but gives you the same results. (This new feature is achieved by using a C library called "MoreFiles", written by Jim Luther, one of Apple's File System "gurus".) | |||||||||||||||||||||||||||||||||
creator as String | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
cs.Creator="ttxt" ' will look for files created by the SimpleText application. | |||||||||||||||||||||||||||||||||
Notes:
The above Creator property allows you to specifiy the search criteria. Without setting any property from this class, a search will find nothing. Note: If you set one of this properties, all criterias must match to get a match back from a call to SearchNext. | |||||||||||||||||||||||||||||||||
FileFlags as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The file flags to search for. | |||||||||||||||||||||||||||||||||
Example:
FileFlags=&H4000 // Invisible FileFlagsMask=&H4000 // only look on the invisible flag | |||||||||||||||||||||||||||||||||
Notes:
The above FileFlags property allows you to specifiy the search criteria. Without setting any property from this class, a search will find nothing. Note: If you set one of this properties, all criterias must match to get a match back from a call to SearchNext. There is a FileFlags and a FileFlagsMask property which must be used together: bits set in FileFlagsMask specifiy which bits of FileFlags shall be tested. Those bits will then be compared to the corresponding bits of the files' (and folders') flags on the searched volume. If they are identical, you have a match. The meaning of the flags are as follows (you can use BitwiseOr or + to combine them):
For example, to find only invisible files, use &H4000 for the FileFlagsMask and the same value for the FileFlags, or to find only visible files, use the same FileFlagsMask, but 0 for the FileFlags. To find stationaries that do not have a custom icon, use &H0C00 (=&H0800+&H0400) for the FileFlagsMask and &H0800 for the FileFlags. | |||||||||||||||||||||||||||||||||
FileFlagsMask as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The file flags mask to search for. | |||||||||||||||||||||||||||||||||
Example:
FileFlags=&H4000 // Invisible FileFlagsMask=&H4000 // only look on the invisible flag | |||||||||||||||||||||||||||||||||
Notes:
The above FileFlagsMask property allows you to specifiy the search criteria. Without setting any property from this class, a search will find nothing. Note: If you set one of this properties, all criterias must match to get a match back from a call to SearchNext. There is a FileFlags and a FileFlagsMask property which must be used together: bits set in FileFlagsMask specifiy which bits of FileFlags shall be tested. Those bits will then be compared to the corresponding bits of the files' (and folders') flags on the searched volume. If they are identical, you have a match. The meaning of the flags are as follows (you can use BitwiseOr or + to combine them):
For example, to find only invisible files, use &H4000 for the FileFlagsMask and the same value for the FileFlags, or to find only visible files, use the same FileFlagsMask, but 0 for the FileFlags. To find stationaries that do not have a custom icon, use &H0C00 (=&H0800+&H0400) for the FileFlagsMask and &H0800 for the FileFlags. | |||||||||||||||||||||||||||||||||
FileType as String | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The file type to look for. | |||||||||||||||||||||||||||||||||
Example:
cs.FileType="TEXT" ' will look for plain Text files. | |||||||||||||||||||||||||||||||||
Notes:
The above Creator property allows you to specifiy the search criteria. Without setting any property from this class, a search will find nothing. Note: If you set one of this properties, all criterias must match to get a match back from a call to SearchNext. | |||||||||||||||||||||||||||||||||
LogicalDataForkSizeEnd as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The maximum logical data fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.LogicalDataForkSizeStart=0 c.LogicalDataForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
LogicalDataForkSizeStart as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The minimum logical data fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.LogicalDataForkSizeStart=0 c.LogicalDataForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
LogicalResForkSizeEnd as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The maximum logical resource fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.LogicalResForkSizeStart=0 c.LogicalResForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
LogicalResForkSizeStart as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The minimum logical resource fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.LogicalResForkSizeStart=0 c.LogicalResForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
name as String | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
Set's the name for the search. | |||||||||||||||||||||||||||||||||
Example:
cs.Name="Apple" cs.partialname=true | |||||||||||||||||||||||||||||||||
Notes:
The above name property allows you to specifiy the search criteria. Without setting any property from this class, a search will find nothing. Note: If you set one of this properties, all criterias must match to get a match back from a call to SearchNext. If you pass true to the partialname property, you'll get a match any time the item's name contains the searched name. Otherwise, the intire name must match. | |||||||||||||||||||||||||||||||||
PartialName as boolean | |||||||||||||||||||||||||||||||||
property, Catalog Search | Sa, 27. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: -> nil. | |||||||||||||||||||||||||||||||
Function:
whether or not the name property contains only a partial file name. | |||||||||||||||||||||||||||||||||
Example:
cs.Name="Apple" cs.partialname=true | |||||||||||||||||||||||||||||||||
Notes:
If you pass true to the partialname property, you'll get a match any time the item's name contains the searched name. Otherwise, the intire name must match. | |||||||||||||||||||||||||||||||||
PhysicalDataForkSizeEnd as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The maximum physical data fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.PhysicalDataForkSizeStart=0 c.PhysicalDataForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
PhysicalDataForkSizeStart as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The minimum physical data fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.PhysicalDataForkSizeStart=0 c.PhysicalDataForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
PhysicalResForkSizeEnd as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The maximum physical resource fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.PhysicalResForkSizeStart=0 c.PhysicalResForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
PhysicalResForkSizeStart as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 12. Aug 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
The minimum physical resource fork file size. | |||||||||||||||||||||||||||||||||
Example:
c.PhysicalResForkSizeStart=0 c.PhysicalResForkSizeEnd=102400 // search for files <= 100 KB. | |||||||||||||||||||||||||||||||||
ResponseTimeout as integer | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
Sets the timeout for the search. | |||||||||||||||||||||||||||||||||
Example:
cs=ResponseTimeout=1000 // one second | |||||||||||||||||||||||||||||||||
Notes:
Sets the maximum time that may pass before SearchNext shall return even if no item has been found yet. The default is 15ms. If you set the timeout to 0, then SearchNext will only return if an item has been found or if the search is finished. Background: Searching for a file or folder, especially if the volume does not support CatSearch, can take a lot of time. While the search is in progress, you might want the user to give still access to your app's user interface. If SearchNext would only return once an item is found, the user interface might not be responsive for several seconds, up to minutes. RB's threads would not help here. To solve this, SearchNext returns in timely intervals even when it has nothing found yet. At that time, RB can respond to any user interaction, if necessary. This happens then automatically. All you have to do is to call SearchNext again. | |||||||||||||||||||||||||||||||||
Result as folderitem | |||||||||||||||||||||||||||||||||
property, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: -> nil. | |||||||||||||||||||||||||||||||
Function:
Returns the current file and returns nil if none was found. | |||||||||||||||||||||||||||||||||
Notes:
After CatSearchNext has returned zero, this functions returns the found item else nil. | |||||||||||||||||||||||||||||||||
Search(volume as FolderItem, allowRecursiveSearch as Boolean) as Boolean | |||||||||||||||||||||||||||||||||
method, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
Initializes the Search engine. | |||||||||||||||||||||||||||||||||
Notes:
Call this to initiate a search a volume. If the returned value is false, then an error has occured (either there's not enough free memory or the volume wasn't valid). If the returned value is true, everything is okay. The volume parameter can be anything that identifies the volume, including any file or folder on it. If allowRecursiveSearch is true and the volume is a folder you search only the folder on this volume, but using recursive directory search. The allowRecursiveSearch parameter determines whether the search shall use the slower recursive directory scan method if the volume does not support CatSearch. If you pass false for a volume that does not support CatSearch, this method will fail, and return false. | |||||||||||||||||||||||||||||||||
SearchNext as Integer | |||||||||||||||||||||||||||||||||
method, Catalog Search | Mo, 22. Jul 2002 | ||||||||||||||||||||||||||||||||
Mac OS Classic: Works. | Mac OS Carbon: Works. | Windows: Does nothing. | |||||||||||||||||||||||||||||||
Function:
Searches for the next machting file | |||||||||||||||||||||||||||||||||
Example:
Here's an example of a proper search loop: dim cs as catsearch .... do If UserCancelled then exit end response = cs.SearchNext if response = 0 then ... read cs.result and process the found item end loop until response < 0 | |||||||||||||||||||||||||||||||||
Notes:
Once the search criteria has been set, call this function repeatedly as long as it returns non-negative values. Once the result is negative, the search is finished and CatSearchClose should be called. These are the possible non-negative return values:
|
Written 2002 by Christian Schmitz. Feel free to ask or report mistakes to realbasic@macsw.de.
Thanks.